from gai.v2.utils import get_or_create_spark_session


def demo_data_for_cell_nullifier():
    spark = get_or_create_spark_session()
    df = spark.createDataFrame(
        [(1, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0009', None, '', ''),
         (1, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0009', -1, '', ''),
         (2, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0008', 0, '', ''),
         (2, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0008', -1, '', ''),
         (3, '20181114', None, 0, '', ''),
         (3, '20181114', None, -1, '', ''),
         (4, '20181126', 'ANDROID-0000db9c08a74a8993c4916abb0b32d0', 0, '', '3'),
         (4, '20181126', 'ANDROID-0000db9c08a74a8993c4916abb0b32d0', -1, '', '3'),
         (5, '20181126', 'ANDROID-846049d187054f4c80ab159de37d8f83', 0, '022000,026400,02d400', '12'),
         (5, '20181126', 'ANDROID-846049d187054f4c80ab159de37d8f83', -1, '022000,026400,02d400', '13'),
         (7, '20181126', 'NON-EXISTENT', 0, '', ''),
         (7, '20181126', 'non-existent', -1, '', ''),
         (8, '20180709', 'ANDROID-000340aa512b4f809ddd3c4c9bc932d0', 0, '02b000,02b100,h0', '14'),
         (8, '20180709', 'ANDROID-000340aa512b4f809ddd3c4c9bc932d0', -1, '02b000,02b100,h0', '15'),
         (9, '20180709', 'ANDROID-00033a1c3f4b4cfd9b502fb0348fd255', 0, '022000,022500,02d300', '7'),
         (9, '20180709', 'ANDROID-00033a1c3f4b4cfd9b502fb0348fd255', -1, '022000,022100,02d300', '9'),
         (11, '20180709', None, 0, '', ''),
         (11, '20180709', None, -1, '', '')],
        schema="secret int, day string, gid_ string, _month_offset int, ft_usertags string, ft_category_cnt string"
    )
    return df


def demo_data_for_missing_value_handler():
    spark = get_or_create_spark_session()
    df = spark.createDataFrame(
        [(1, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0009', None, '', None),
         (1, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0009', -1, '', None),
         (2, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0008', 0, '', None),
         (2, '20181114', 'ANDROID-68b6c301c39c4b37b7b8fb276dba0008', -1, '', None),
         (3, '20181114', None, 0, '', None),
         (3, '20181114', None, -1, '', None),
         (4, '20181126', 'ANDROID-0000db9c08a74a8993c4916abb0b32d0', 0, '', '3'),
         (4, '20181126', 'ANDROID-0000db9c08a74a8993c4916abb0b32d0', -1, '', '3'),
         (5, '20181126', 'ANDROID-846049d187054f4c80ab159de37d8f83', 0, '022000,026400,02d400', '12'),
         (5, '20181126', 'ANDROID-846049d187054f4c80ab159de37d8f83', -1, '022000,026400,02d400', '13'),
         (7, '20181126', None, 0, '', None),
         (7, '20181126', None, -1, '', None),
         (8, '20180709', 'ANDROID-000340aa512b4f809ddd3c4c9bc932d0', 0, '02b000,02b100,h0', '14'),
         (8, '20180709', 'ANDROID-000340aa512b4f809ddd3c4c9bc932d0', -1, '02b000,02b100,h0', '15'),
         (9, '20180709', 'ANDROID-00033a1c3f4b4cfd9b502fb0348fd255', 0, '022000,022500,02d300', '7'),
         (9, '20180709', 'ANDROID-00033a1c3f4b4cfd9b502fb0348fd255', -1, '022000,022100,02d300', '9'),
         (11, '20180709', None, 0, '', None),
         (11, '20180709', None, -1, '', None)],
        schema="secret int, day string, gid_ string, _month_offset int, ft_usertags string, ft_category_cnt string"
    )
    return df
